﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;

namespace WPFSortableCollectionTest.Model
{
    [Serializable]
    public class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }

        public static List<Person> GetPeople()
        {
            List<Person> people = new List<Person>();

            XmlSerializer serializer = new XmlSerializer(typeof(List<Person>));

            FileStream stream = File.Open("Data\\data.xml", FileMode.Open);

            people = serializer.Deserialize(stream) as List<Person>;

            stream.Close();

            return people;
        }
    }
}
